<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./js/vue-2.4.0.js"></script>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      ul {
        display: flex;
        list-style-type: none;
      }
      li {
        border: 1px solid black;
        width: 100px;
        height: 100px;
        text-align: center;
        line-height: 100px;
      }
      .active {
        background-color: aqua;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <ul class="tab-tilte">
        <li @click="cur=0" :class="{active:cur==0}">标题一</li>
        <li @click="cur=1" :class="{active:cur==1}">标题二</li>
        <li @click="cur=2" :class="{active:cur==2}">标题三</li>
        <li @click="cur=3" :class="{active:cur==3}">标题四</li>
      </ul>
      <div class="tab-content">
        <div v-show="cur==0">内容一</div>
        <div v-show="cur==1">内容二</div>
        <div v-show="cur==2">内容三</div>
        <div v-show="cur==3">内容四</div>
      </div>
    </div>
  </body>
  <script>
    let app = new Vue({
      el: "#app",
      data: {
        cur: 0,
      },
      methods: {},
    });
  </script>
</html>
